/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package savet.util;

import java.util.LinkedList;
import java.util.List;
import savet.entidades.atributos.Legenda;

/**
 *
 * @author Rafael
 */
public class ListLegendas {

    private static ListLegendas instance;
    private List<Legenda> list;

    private ListLegendas() {
        list = new LinkedList<Legenda>();
    }

    public static ListLegendas getInstance() {
        if (instance == null) {
            instance = new ListLegendas();
        }
        return instance;
    }

    public List<Legenda> getList() {
        return list;
    }

    public void setList(List<Legenda> list) {
        if (this.list == null) {
            this.list = new LinkedList<Legenda>(list);
        }else{
            this.list.addAll(list);
        }
    }

    public void addLegenda(Legenda legenda) {
        list.add(legenda);
    }

    public Boolean removeLegenda(Legenda legenda) {
        return list.remove(legenda);
    }
}
